﻿@using XCode.Statistics;
@{
    // 所有可用层级
    var vs = Model as StatLevels[];
    var ds = System.EnumHelper.GetDescriptions(typeof(StatLevels));
    var def = StatLevels.All;
    if (vs != null && vs.Length > 0)
    {
        ds = vs.ToDictionary(e => (Int32)e, e => e.GetDescription());
        def = vs[0];
    }

    var page = ViewBag.Page as Pager;

    var n = page["Level"].ToInt(-1);
    var level = n >= 0 ? (StatLevels)n : def;
}
<div class="form-group">
    @Html.ForDropDownList("Level", ds, (Int32)level, null, true)
</div>
@await Html.PartialAsync("_DateRange")